#!/bin/sh

# Path to Faxviewer DB
faxviewer_db_path='/srv/www/htdocs/faxviewer/db/faxviewer.db'

# HylaFax Inbox Folder 
hylafax_inbox_path='/var/spool/hylafax/recvq'


#Borra faxes clasificados como trash (papelera)
faxes=`sqlite3 $faxviewer_db_path "select id from recvq where softfolder='trash'"`
for i in `echo $faxes`; do
rm $hylafax_inbox_path/$i.tif
sqlite3 $faxviewer_db_path "delete from recvq where softfolder='trash'"
done